secp256k1: Misc cleanup and modernize.#3712
Merged
davecgh merged 6 commits intoJul 8, 2026
Merged
Conversation
4d3aa9a to
cdf2677
Compare
dajohi
approved these changes
Jul 1, 2026
jholdstock
approved these changes
Jul 6, 2026
cdf2677 to
8b33cc5
Compare
jholdstock
approved these changes
Jul 8, 2026
This updates the code to use the more modern documentation links when referencing other methods and symbols.
This updates the tests to consistently make use of the helper methods that parse hex to 10x26 field vals and panic if they represent invalid values. Since some of the tests intentionally involve values that overflow the max allowed value, the helpers are reworked slightly to either allow overflow or not and all tests are updated accordingly. Finally, it renames the helpers that panic to the more canonical mustX scheme.
This updates the tests to consistently make use of the helper methods that parse hex to 4x64 field vals and panic if they represent invalid values. Since some of the tests intentionally involve values that overflow the max allowed value, the helpers are reworked slightly to either allow overflow or not and all tests are updated accordingly. Finally, it renames the helpers that panic to the more canonical mustX scheme.
This updates the tests to consistently make use of the helper methods that parse hex to mod n scalars and panic if they represent invalid values. Since some of the tests intentionally involve values that overflow the max allowed value, the helpers are reworked slightly to either allow overflow or not and all tests are updated accordingly.
This removes a few 10x26 field tests that aren't actually testing anything related to the associated methods because they involve unreduced outputs which are impossible. The outputs are necessarily reduced when they are parsed by the test code which mean, at best, it's testing a few isolated cases of parsing reduction, but that is explicitly tested much more thoroughly elsewhere.
This removes a few 4x64 field tests that aren't actually testing anything related to the associated methods because they involve unreduced outputs which are impossible. The outputs are necessarily reduced when they are parsed by the test code which mean, at best, it's testing a few isolated cases of parsing reduction, but that is explicitly tested much more thoroughly elsewhere.
8b33cc5 to
c2d2b54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This requires #3711.This consists of a series of commits that perform some light cleanup and modernization of the secp256k1 code.
The following is a high level overview of the changes:
See the individual commits for more details.